
public class TestHungrySingleton {

    public static void main(String[] args) {

        HungrySingleton singleton1 = HungrySingleton.getInstance();
        HungrySingleton singleton2 = HungrySingleton.getInstance();

        System.out.println(singleton1 == singleton2);

        HungryStaticSingleton singleton3 = HungryStaticSingleton.getInstance();
        HungryStaticSingleton singleton4 = HungryStaticSingleton.getInstance();

        System.out.println(singleton3 == singleton4);

    }
}